package mr.fresh.entity.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import mr.fresh.entity.manange.FreshPic;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @CLassName SaveGoodRequest
 * @Description TODO 商品请求模型
 * @Author mr.jl
 * @Date 2019/6/7 16:54
 * @Version 1.0
 **/
@Data
@AllArgsConstructor
@ApiModel("SaveGoodRequest")
public class SaveGoodRequest {

    @ApiModelProperty(value = "商品id")
    private Long goodId;

    @NotNull(message = "分类id不能为空")
    @ApiModelProperty(value = "分类id")
    private Integer categoryId;

    @NotBlank(message = "商品名称不能为空")
    @ApiModelProperty(value = "商品名称")
    private String goodName;

    @Min(value = 0, message = "最低价格不能低于0")
    @NotNull(message = "商品价格不能为空")
    @ApiModelProperty(value = "价格")
    private BigDecimal goodPrice;

    @NotBlank(message = "商品名称不能为空")
    @ApiModelProperty(value = "商品介绍")
    private String goodDesc;

    @Min(value = 0, message = "不能选择0")
    @NotNull(message = "商品状态不能为空")
    @ApiModelProperty(value = "上下架（1上架，2下架)")
    private Byte goodStatus;

    @ApiModelProperty(value = "商品图片集合")
    private List<FreshPic> picList;
}
